package com.oa.modules.approvalsec1.socket;

import com.oa.modules.approvalsec1.service.AssistInManagingService;
import com.oa.modules.approvalsec1.service.NewsNoticeService;
import com.oa.modules.sys.controller.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * websocket反推数据
 *
 * @author Administrator
 */
@RestController
@RequestMapping("/websocketController")
public class WebsocketController extends AbstractController {

    @Autowired
    private NewsNoticeService newsNoticeService;

    /**
     * 利用mysql-udf-http反推到后台,后台利用websocket反推数据到前台,达到实时数据推送的方法
     *
     * @return
     */
    @GetMapping("/pushToWeb")
    @ResponseBody
    public String getString(){
        newsNoticeService.pushToWeb();
        return "push success";
    }
}
